<?php $this->load->view('layout/header'); ?>
<script src="/static/bk/js/table.js" type="text/javascript"></script>
<div>
</div>

<script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['form1'];
    if (!theForm) {
        theForm = document.form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
</script>
<div>
</div>
<div id="container">
    <!--导航开始-->
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_nav">
        <tr>
            <td>
                数据库备份(当前数据库类型:mysql)
            </td>
        </tr>
    </table>
    <!--导航结束-->
    <!--列表开始-->
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_list">
        <tr class="table_form_btn">
            <td style="text-align: left;">
                <input type="submit" id="export_sql" value="备份">(注:备份成功后,请登录FTP到目录/static/sql-backup下载)
            </td>
        </tr>
    </table>
    <!--列表结束-->
</div>
<?php $this->load->view('layout/footer'); ?>

<script type="text/javascript">
    $("#export_sql").click(function(){
        $.ajax({
            type: "POST",
            url: "/admin.php/extension/back_up",
            data: "",
            beforeSend:
                function () {
                },
            success:
                function (data) {
                    if(data){
                        alert('备份成功');
                        window.location.reload();
                    }
                }
        });
    });
</script>

